package net.hn.hnms.biz.plan.enums;


import cn.hutool.core.util.StrUtil;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 计划类型
 */
public enum CompanyType {

    BEINENG("91150100767874571R","北能公司"),
    LINGLU("91150781720169744B","扎煤公司"),
    HETAOYU("91621000566400003E","庆阳公司"),
    HUATING("916200002258722645","华亭公司");


    private String companyCode;



    private String name;



    private static List<String> companyNameList = new ArrayList<>();

    private static Map<String,String> codeAndNameOfMap = new HashMap<>();


    CompanyType(String companyCode, String name) {

        this.companyCode = companyCode;
        this.name = name;

    }

    public String getName(){
        return name;
    }



    public String getCompanyCode() {
        return companyCode;
    }







    /**
     * 根据矿编码获取矿名称
     * @param code
     * @return
     */

    public static String getNameByCode(String code){
        CompanyType[] values = values();
        for (CompanyType value : values) {
            if(StrUtil.equalsIgnoreCase(value.getCompanyCode(),code)) return value.getName();
        }
        return null;
    }


}
